{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>使用ajax</title>

    {% load static %}
   {% comment %}<script type="text/javascript" src="{% static '/js/jquery-3.5.1.min.js' %}"></script>{% endcomment %}
    <script src="http://119.23.182.180/jquery-3.5.1.min.js"></script>
    {% comment %}暂时还不知道怎么导入静态文件，就暂时用服务器的jQuery文件代替一下{% endcomment %}

    <script type="text/javascript">
        function a(){
            //alert('ajax handle');
            //发送jq的ajax到/getAjax
            $.ajax({
                url:'../getAjax',
                type:'get',
                //用get方法发送
                data:{'message':'Hello!!!!! It\'s Ajax!'},
                success:function (data){
                    alert(data)
                }
            })
        }
    </script>
</head>
<body>
<div>
    <div>
        <button onclick="a()">提交Ajax</button>
    </div>
</div>

</body>
</html>